package com.szlanyou.thirdsdk.retrofit.interceptor;

import com.szlanyou.thirdsdk.retrofit.client.HttpMaster;
import com.szlanyou.thirdsdk.retrofit.file.download.IHttpDownloadProgressResultHandler;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * @author 陈章
 * create at 2021/7/9 11:46
 * desc:
 * 存储一些公用的信息
 */
public class ShareInfoHelper {
    public static  final String METHOD_POST = "post";


    /**
     * 正在执行的下载链接
     */
    private static List<String> downloadUrlCacheList = new ArrayList<>();


    /**
     * when {@link HttpMaster#downloadFile(String, File, IHttpDownloadProgressResultHandler, int...)} execute,remember the url
     * @param downloadUrl
     */
    public static void addDownloadUrl(String downloadUrl){
        downloadUrlCacheList.add(downloadUrl);
    }


    /**
     *when {@link HttpMaster#downloadFile(String, File, IHttpDownloadProgressResultHandler, int...)} finish,remove the url
     * @param downloadUrl
     */
    public static void removeDownloadUrl(String downloadUrl){
        downloadUrlCacheList.remove(downloadUrl);
    }

    public static List<String> getDownloadUrlCacheList() {
        return downloadUrlCacheList;
    }
}
